﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.ComponentModel.DataAnnotations;
using CanDoo.Core.Data;
using CanDoo.Data;
using CanDoo.Admin.Core.Models;

namespace CanDoo.Oil.Core.Models
{
    /// <summary>
    /// 实体类——仓库
    /// </summary>
    [Serializable]
    [Description("仓库")]
    public class Warehouse :  EntityBase,ICreatedTime, IAudited,IRecyclable
    {
        /// <summary>
        ///编号
        /// </summary>
        [Display(Name = "编号")]
        [Required, StringLength(50)]
        public string Code { get; set; }

        /// <summary>
        ///仓库类别
        /// </summary>
        [Display(Name = "仓库类别")]
        public virtual WarehouseType WarehouseType { get; set; }
        /// <summary>
        ///仓库类别外键
        /// </summary>
        [Display(Name = "仓库类别外键")]
        public long WarehouseTypeId { get; set; }

        /// <summary>
        ///仓库名称
        /// </summary>
        [Display(Name = "仓库名称")]
        [Required, StringLength(50)]
        public override string Name { get; set; }

        /// <summary>
        ///负责人
        /// </summary>
        [Display(Name = "负责人")]
        [StringLength(50)]
        public string Manager { get; set; }

        /// <summary>
        ///联系电话
        /// </summary>
        [Display(Name = "联系电话")]
        [StringLength(50)]
        public string Tel { get; set; }

        /// <summary>
        ///仓库地址
        /// </summary>
        [Display(Name = "仓库地址")]
        [StringLength(200)]
        public string Address { get; set; }

        /// <summary>
        ///备注
        /// </summary>
        [Display(Name = "备注")]
        [StringLength(500)]
        public string Remark { get; set; }

        
        #region Implementation of ICreatedTime

        /// <summary>
        /// 获取设置 信息创建时间
        /// </summary>
        [Display(Name = "创建时间")]
        public DateTime CreatedTime { get; set; }
        #endregion

        #region Implementation of ICreatedAudited

        /// <summary>
        /// 获取或设置 创建者编号
        /// </summary>
        [Display(Name = "创建人")]
        public string CreatorUserId { get; set; }

        #endregion

        #region Implementation of IUpdateAutited

        /// <summary>
        /// 获取或设置 最后更新时间
        /// </summary>
        [Display(Name = "最后更新时间")]
        public DateTime? LastUpdatedTime { get; set; }

        /// <summary>
        /// 获取或设置 最后更新者编号
        /// </summary>
        [Display(Name = "最后更新用户")]
        public string LastUpdatorUserId { get; set; }

        #endregion

        #region Implementation of IsDeleted 逻辑删除接口
        /// <summary>
        /// 逻辑删除接口
        /// </summary>
        [Display(Name = "是否删除")]
        public bool IsDeleted { get; set; }
        #endregion
    }
}
